package cate.common.table.item.spice.row;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;

import java.util.HashMap;
import java.util.Map;

@EExcelRowClass(IDTitle = "道具ID")
public class SpiceItemRow extends ERow {
    @EExcelNoteField(fieldName = "直升起始等级")
    public int startLevel;
    @EExcelNoteField(fieldName = "直升结束等级")
    public int endLevel;
    @EExcelNoteField(fieldName = "消耗")
    private String consumeStr;

    public Map<Integer, Integer> consumes;
    @Override
    public void decode() {
        consumes = new HashMap<>();
        String[] arr = consumeStr.split("#");
        for (String str : arr) {
            consumes.put(Integer.parseInt(str.split(":")[0]), Integer.parseInt(str.split(":")[1]));
        }
    }
}
